package com.it.test;

public class test8 {
    public static void main(String[] args) {
        //解密
        //先反转
        //再将对10求余的数还原
        //再加5
        int[] arr ={8,3,4,6};
        for (int i = 0, j = arr.length-1; i < j; i++,j--) {
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        /*for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
        }*/
        //分析：
        //由于加密是通过对10取余的方式进行获取的
        //所以在解密的时候需要判断，0~4之间+10 5~9数字不变，
        //任何一个数单个“位”只能是0~9，+5最大14
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] >= 0 && arr[i] <=4){
                arr[i] =arr[i]+10;
            }
        }
        //再每一位减5
        for (int i = 0; i < arr.length; i++) {
            arr[i] =arr[i]-5;
        }
        //链接
        int number = 0;
        for (int i = 0; i < arr.length; i++) {
            number = number * 10 + arr[i];
        }
        System.out.println(number);
    }
}
